#include<iostream>
#include<unordered_map>
using namespace std;
const int N = 1e6 + 10;
int a[N];
int m, n;
int ret = 0x3f3f3f3f;

int main()
{
    cin >> n >> m;
    for(int i = 1; i <= n; i++)
    {
        cin >> a[i];
    }
    unordered_map<int, int> mp;
    int left = 1, right = 1, key = 0, l = 0, r = 0;
    while(right <= n)
    {
        if(++mp[a[right]] == 1)
        {
            key++;
        }
        while(key == m)
        {
            if(ret > right - left + 1)
            {
                ret = min(ret, right - left + 1);
                l = left, r = right;
            }
            if(--mp[a[left++]] == 0)
            {
                key--;
            }
        }
        right++;
    }
    cout << l << " " << r << endl;
    return 0;
}
